Different languages have different directions in reading. For example, Chinese, English or Latin are usually read (written) from left to right, while Uyghur, Arabic or Hebrew are usually read (written) from right to left. Therefore, different languages are typeset with different directions (i.e. a relationship between orders of inputting characters and locations of the typeset characters) so that characters are shown in different order in newspaper or books.
Obviously, characters are input to a small sample according to the order of their meaning rather than depending on the typesetting direction. In the existing bidirectional typesetting methods, characters in the small sample may be reversed directly, that is, the order of characters stored in the small sample is inverted, and then a big sample is constructed with the reversed small sample. For example, if there are Chinese characters “” in a document which mainly consists of Uyghur and has a fault typesetting direction from right to left, “” will be acquired by inverting “” in the small sample according to the existing bidirectional typesetting methods. However, a result containing correct Chinese and Uyghur as shown in FIG. 1 will be acquired by constructing the big sample with the reversed small sample according to the fault typesetting direction from right to left.
The inventor found that the following issue exists in the prior art: the reversed characters which are stored in the small sample are disorder, since characters in the small sample are reversed directly in the existing bidirectional typesetting methods. Therefore, it is difficult to exchange data (modify the small sample). In the above example of “”, if it will be modified to be “” by inserting characters “” behind the characters “”, since the characters “” stored in the small sample do not conform to the Chinese language habits, it is difficult for a user to decide where the characters “” shall be inserted. In addition, the user does not know how to reverse these characters, since other Chinese characters have been reversed. Meanwhile, due to format change, such as folding, is easy to bring an error during constructing the big sample. In the above example of “”, if there are spaces for 5 Chinese characters in the first row, a typesetting result shown in FIG. 2 will be obtained according to the existing typesetting method, that is, characters “” in the first row of the big sample are generated by reversing the first five characters “” in the small sample and typesetting the reversed characters from right to left. The characters “” are generated in the second row of the big sample by typesetting the remaining characters in the small sample. Although the order of Chinese characters (from left to right) in each row are correct, the overall typesetting result is “”, which is disorder, that is, the characters which shall be in the first row are in the second row, while the characters which shall be in the second row are in the first row.
Herein, a character, a small sample and a big sample are commonly used terminology in the field of typesetting. The character usually refers to the smallest unit of text which may be input to an electronic equipment, and includes a text character (such as Chinese characters, English letters and etc.), a sign character (such as a comma, full stop, etc.), a format character (such as foldings etc.) and so on. The small sample usually refers to a file used in a process of typesetting including contents of a document (such as character, and order of the characters). The big sample usually refers to a file which is obtained from the small sample and used in a process of typesetting including typeset location information (such as where a certain character locates), in which the location of a character may be represented by a row index (i.e., which row the character locates), a location index (i.e., the place where the character locates in the row).